home *** CD-ROM | disk | FTP | other *** search
- #include <graphics.h>
-
- main()
- {
- int errorcode;
- int graphdriver = DETECT;
- int graphmode;
-
- /* Detect and initialize graphics system */
- initgraph(&graphdriver, &graphmode, "c:\\turboc");
- errorcode = graphresult();
- if (errorcode != grOk)
- {
- printf("Graphics error: %s\n", grapherrormsg(errorcode));
- exit(1);
- };
-
- settextjustify(CENTER_TEXT, CENTER_TEXT);
- settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 1);
- outtextxy( getmaxx() / 2, getmaxy() / 2,
- "Graphics programs need initgraph() and closegraph()");
- outtextxy(getmaxx()/2, getmaxy() - 50, "Press any key to exit:");
- getch(); /* Wait until a key is pressed */
- closegraph(); /* Exit graphics library */
- }